package sg.edu.nus.iss.pacman.dao;

import javax.microedition.rms.RecordFilter;

import sg.edu.nus.iss.pacman.util.IOUtils;

/**
 * Maze filter based on name of maze
 * 
 * @author Daniel
 *
 */
public class MazeFilter implements RecordFilter {

	private String mazeName;
	
	public MazeFilter(String name) {
		this.mazeName = name;
	}
	
	public boolean matches(byte[] byteMaze) {
		
		Maze maze = IOUtils.convertBytesToMaze(byteMaze);

		if (maze.getMazeName().equals(mazeName)) {
			return true;
		}
		return false;
	}

}
